package com.itheima.wangyc.controller;

import com.itheima.wangyc.pojo.Goods;
import com.itheima.wangyc.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author wangyoucheng
 * @date 2025/9/20
 * @description TOD0
 */
@RestController
@RequestMapping("/goods")
public class GoodsController {
    @Autowired
    private GoodsService goodsService;



    @GetMapping("/{categoryId}")
    public List<Goods> queryList(@PathVariable("categoryId") String categoryId, @RequestParam(value = "name",required = false) String name
    , @RequestParam(value = "pageNo",defaultValue = "1") Long pageNo, @RequestParam(value = "pageSize",defaultValue = "10") Long pageSize) {

        return goodsService.queryList(categoryId,name,pageNo,pageSize);
    }




}
